﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SharedCode;
using AdminModule.IndexMarkServiceReference;
using System.Collections.ObjectModel;

namespace AdminModule.ViewModels
{
    public class EditDepartmentVM : ViewModelBase
    {
        private IndexMarkServiceClient client = new IndexMarkServiceClient();

        private ObservableCollection<AdmDepartmentType> _depTypes = new ObservableCollection<AdmDepartmentType>();
        public ObservableCollection<AdmDepartmentType> depTypes
        {
            get { return this._depTypes; }
            set { this._depTypes = value; }
        }

        public override void Init()
        {
            base.Init();

            client.GetAdmDepartmentTypesCompleted += (s, ev) =>
                {
                    _depTypes.LoadWithClear(ev.Result);
                    this.RaiseInitCompleted();
                };
            client.GetAdmDepartmentTypesAsync();
        }
    }
}
